﻿Imports Training.Common

Partial Public Class PurgeUserResults
    Inherits System.Web.UI.Page
    Public gName As String ' group name
    Dim gid As Integer ' groupid

    ''' <summary>
    ''' Page Load event, check for querystring data and assign to variables
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' check for querystring data
        If IsNothing(Request.QueryString("gid")) Or IsNothing(Request.QueryString("nm")) Then
            Response.Redirect("Groups.aspx")
        Else
            gid = Request.QueryString("gid")
            gName = Request.QueryString("nm")

            ' set label for groupname
            lblGroup.Text = gName
        End If
    End Sub

    ''' <summary>
    ''' Cancel Button Click Event. Redirect back to Manage Groups
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Response.Redirect("Groups.aspx")
    End Sub

    ''' <summary>
    ''' Delete Group User Results
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        DeleteGroupUserResults(gid)
        pre.Visible = False
        post.Visible = True
    End Sub
End Class